<?php
include 'init.php';

$admin = new Admin();
$admin->checkAdmin();

if($_GET['method'] == 'menu_delete'){
    
}

if($_GET['method'] == 'menu_add')
{
    
}


if($_GET['method'] == 'add_admin'){
    $s = new SettingsAdmin;
    $result = $s->addAdmin($_GET['name'],$_GET['password']);
    if($result == 'yes')
    {
        echo json_encode(array('result'=>true,'error'=>0));
    }else{
        echo json_encode(array('result'=>false,'error'=>1,'error_message'=>($result=='no')?'Ошибка базы данных':$result));
    }
}
?>
